# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.ContentWarehouse.V1.Model.GoogleCloudDocumentaiV1DocumentEntityNormalizedValue do
  @moduledoc """
  Parsed and normalized entity value.

  ## Attributes

  *   `addressValue` (*type:* `GoogleApi.ContentWarehouse.V1.Model.GoogleTypePostalAddress.t`, *default:* `nil`) - Postal address. See also: https://github.com/googleapis/googleapis/blob/master/google/type/postal_address.proto
  *   `booleanValue` (*type:* `boolean()`, *default:* `nil`) - Boolean value. Can be used for entities with binary values, or for checkboxes.
  *   `dateValue` (*type:* `GoogleApi.ContentWarehouse.V1.Model.GoogleTypeDate.t`, *default:* `nil`) - Date value. Includes year, month, day. See also: https://github.com/googleapis/googleapis/blob/master/google/type/date.proto
  *   `datetimeValue` (*type:* `GoogleApi.ContentWarehouse.V1.Model.GoogleTypeDateTime.t`, *default:* `nil`) - DateTime value. Includes date, time, and timezone. See also: https://github.com/googleapis/googleapis/blob/master/google/type/datetime.proto
  *   `floatValue` (*type:* `number()`, *default:* `nil`) - Float value.
  *   `integerValue` (*type:* `integer()`, *default:* `nil`) - Integer value.
  *   `moneyValue` (*type:* `GoogleApi.ContentWarehouse.V1.Model.GoogleTypeMoney.t`, *default:* `nil`) - Money value. See also: https://github.com/googleapis/googleapis/blob/master/google/type/money.proto
  *   `text` (*type:* `String.t`, *default:* `nil`) - Optional. An optional field to store a normalized string. For some entity types, one of respective `structured_value` fields may also be populated. Also not all the types of `structured_value` will be normalized. For example, some processors may not generate `float` or `integer` normalized text by default. Below are sample formats mapped to structured values. - Money/Currency type (`money_value`) is in the ISO 4217 text format. - Date type (`date_value`) is in the ISO 8601 text format. - Datetime type (`datetime_value`) is in the ISO 8601 text format.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :addressValue => GoogleApi.ContentWarehouse.V1.Model.GoogleTypePostalAddress.t() | nil,
          :booleanValue => boolean() | nil,
          :dateValue => GoogleApi.ContentWarehouse.V1.Model.GoogleTypeDate.t() | nil,
          :datetimeValue => GoogleApi.ContentWarehouse.V1.Model.GoogleTypeDateTime.t() | nil,
          :floatValue => number() | nil,
          :integerValue => integer() | nil,
          :moneyValue => GoogleApi.ContentWarehouse.V1.Model.GoogleTypeMoney.t() | nil,
          :text => String.t() | nil
        }

  field(:addressValue, as: GoogleApi.ContentWarehouse.V1.Model.GoogleTypePostalAddress)
  field(:booleanValue)
  field(:dateValue, as: GoogleApi.ContentWarehouse.V1.Model.GoogleTypeDate)
  field(:datetimeValue, as: GoogleApi.ContentWarehouse.V1.Model.GoogleTypeDateTime)
  field(:floatValue)
  field(:integerValue)
  field(:moneyValue, as: GoogleApi.ContentWarehouse.V1.Model.GoogleTypeMoney)
  field(:text)
end

defimpl Poison.Decoder,
  for: GoogleApi.ContentWarehouse.V1.Model.GoogleCloudDocumentaiV1DocumentEntityNormalizedValue do
  def decode(value, options) do
    GoogleApi.ContentWarehouse.V1.Model.GoogleCloudDocumentaiV1DocumentEntityNormalizedValue.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.ContentWarehouse.V1.Model.GoogleCloudDocumentaiV1DocumentEntityNormalizedValue do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
